package com.lanou.myapplication.technologyAdapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lanou.myapplication.entertainmentFragment.HeadLineFragment2;
import com.lanou.myapplication.entity.Educate;
import com.lanou.myapplication.entity.Entertainment;
import com.lanou.myapplication.entity.Technology;
import com.lanou.myapplication.technologyFragment.HeadLineFragment6;

import java.util.List;

/**
 * Created by dllo on 15/10/23.
 */
public class ViewPagerAdapter6 extends FragmentPagerAdapter {
    private List<Technology.T1348649580692Entity> t1348649580692Entities;

    public void addData(List<Technology.T1348649580692Entity> data){
        t1348649580692Entities =data;
      notifyDataSetChanged();
    }


    public ViewPagerAdapter6(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Technology.T1348649580692Entity l =  t1348649580692Entities.get(position);
        String title =l.getTitle();
        String imgsrc=l.getImgsrc();

        return HeadLineFragment6.getInstance(title, imgsrc);
    }

    @Override
    public int getCount() {
        return t1348649580692Entities != null && t1348649580692Entities.size() > 0
          ? t1348649580692Entities.size() :0;
    }
}
